<!-- 能耗分析-->

<template>
    <div class="wrapper">
        <div class="iframeBox">
            <iframe v-show="theme === 'dark'" :src="iframeUrlD"></iframe>
            <iframe v-show="theme === 'white'" :src="iframeUrlW"></iframe>
        </div>
    </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';

import { storeToRefs } from 'pinia';
import { useThemeStore } from '@/store/modules/theme';

import * as local from '@/utils/cache/localStorage';

const { APP_VOLCANO_BI_DATAS, JWT_TOKEN } = window.config;

const themeStore = useThemeStore();

const { theme } = storeToRefs(themeStore);

const iframeUrlD = ref('');
const iframeUrlW = ref('');

onMounted(() => {
    const jwtToken = local.getItem('jwtToken') || JWT_TOKEN;
    iframeUrlD.value = `${APP_VOLCANO_BI_DATAS[2].blueUrl}&jwtToken=${jwtToken}`;
	iframeUrlW.value = `${APP_VOLCANO_BI_DATAS[2].whiteUrl}&jwtToken=${jwtToken}`;
});
</script>

<style lang="scss" scoped>

</style>